home *** CD-ROM | disk | FTP | other *** search
- /* filemode.mrbk */
-
- /* This ARexx script plays with MRBackup's filemode setting. */
-
- signal on ERROR
- signal on BREAK_C
-
- parse source type res called resolved ext host
-
- options results
-
- if ~(Show('P', 'MRBackup_#1')) then do
- say "You must run MRBackup first. With a little work, you could"
- say "get this ARexx script to do it for you."
- exit 1
- end
-
- address "MRBackup_#1"
-
- /* poptofront */
-
- 'getfilemode'
- if rc ~= 0 then do
- say "Failed to get filemode setting; rc = " || rc
- exit rc
- end
-
- filemode = result
-
- say "Current filemode: " || filemode
-
- if filemode = "Replace" then
- filemode = "Append"
- else
- filemode = "Replace";
-
- setfilemode filemode
- if rc ~= 0 then do
- say "Failed to set filemode; rc = " || rc
- exit rc
- end
-
- getfilemode
-
- say " Filemode is now set to " || result
-
- exit 0
-
-
- /*------------------------------------------------------------------*/
-
- break_c:
-
- say "*** Control-C recieved. Stopped by user. ***"
- exit 5
-
- /*------------------------------------------------------------------*/
-
- error:
-
- say "Error"
- exit 6
-
- /*------------------------------------------------------------------*/
-
-